package cn.usian.pricingstrategy.coefficient.service.impl;

import cn.usian.pojo.pricingstrategy.coefficient.PricingSpecialCoefficient;
import cn.usian.pricingstrategy.coefficient.mapper.CoefficientMapper;
import cn.usian.pricingstrategy.coefficient.service.ICoefficientService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class CoefficientServiceImpl implements ICoefficientService {
    @Autowired
    private CoefficientMapper coefficientMapper;

    @Override
    public List<PricingSpecialCoefficient> list() {
        return coefficientMapper.list();
    }

    @Override
    public void save(PricingSpecialCoefficient pricingSpecialCoefficient) {
        log.info("保存系数信息：{}",pricingSpecialCoefficient);
        coefficientMapper.update(pricingSpecialCoefficient);
    }

    @Override
    public PricingSpecialCoefficient findById(Long id) {
        return coefficientMapper.findById(id);
    }

    @Override
    public void update(PricingSpecialCoefficient pricingSpecialCoefficient) {
        coefficientMapper.update(pricingSpecialCoefficient);
    }
}
